<%@ tag import="su.mvc.action.ActionSupport" %>
<%@ tag import="su.mvc.service.UserService" %>
<%@ tag import="su.mvc.service.gui.GuiService" %>
<%@ tag import="com.googlecode.objectify.Objectify" %>
<%@ tag language="java" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>


<%

    UserService userService = ((GuiService)request.getAttribute(ActionSupport.GUI_SERVICE)).getUserService();
    userService.setObjectify((Objectify)request.getAttribute(ActionSupport.OBJECTIFY));
    if (userService.isUserAdmin() ){
        jspContext.setAttribute("isAdmin", true);
    }

%>

<c:if test="${isAdmin}">
    <div id="admin-menu">
    <fmt:bundle basename="global">
        <ul>
            <li><b><fmt:message key="menu.admin" /></b></li>
            <li><a href="/admin/menu"><fmt:message key="menu.admin.menu" /></a></li>
            <li><a href="/admin/images"><fmt:message key="menu.admin.images" /></a></li>
            <ul>
                <li><a href="/admin/upload"><fmt:message key="menu.admin.upload" /></a></li>
            </ul>
        </ul>
    </fmt:bundle>
    </div>
</c:if>